#include "sdk.h"
#include "asktypedlg.h"

AskTypeDlg::AskTypeDlg( wxWindow* parent, const wxString StreamStart, const wxString StreamEnd ) {
  wxXmlResource* xml_res = wxXmlResource::Get();
  wxString resPath = ConfigManager::GetDataFolder() + _T( "/ask_type.xrc" );
  xml_res->Load( resPath );
  if( !xml_res->LoadObject( this, parent, _T( "dlgAskType" ), _T( "wxScrollingDialog" ) ) ) {
    return;
  }
  wxChoice *choice = XRCCTRL( *this, "chcCorrect", wxChoice );
  choice->Clear();
  choice->Append( _T( "保留行注释样式并将其移动到行的末尾" ) );
  choice->Append( _T( "将行注释样式保留在当前位置" ) );
  if( !StreamStart.IsEmpty() ) {
    wxString str = _( "switch to stream style comment (" ) + StreamStart + _T( " ... " ) + StreamEnd + _T( ")" );
    choice->Append( str );
  }
  choice->SetSelection( 0 );
}

AskTypeDlg::~AskTypeDlg() {
}

TypeCorrection AskTypeDlg::GetTypeCorrection() const {
  return static_cast<TypeCorrection>( XRCCTRL( *this, "chcCorrect", wxChoice )->GetSelection() );
}

